//package com.heiTie.heiTie.config;
//
//
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
////import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
//
////上传配置类
////图片放到/F:/fileUpload/后，从磁盘读取的图片数据scr将会变成images/picturename.jpg的格式
//@Configuration
//public class WebVideConfig extends WebMvcConfigurationSupport {
//    @Value("${cbs.imagesPath}")
//    private String mImagesPath;
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        if(mImagesPath.equals("") || mImagesPath.equals("${cbs.imagesPath}")){
//            String imagesPath = WebVideConfig.class.getClassLoader().getResource("").getPath();
//            System.out.print("1.上传配置类imagesPath=="+imagesPath+"\n");
//            if(imagesPath.indexOf(".jar")>0){
//                imagesPath = imagesPath.substring(0, imagesPath.indexOf(".jar"));
//            }else if(imagesPath.indexOf("classes")>0){
//                imagesPath = "file:"+imagesPath.substring(0, imagesPath.indexOf("classes"));
//            }
//            imagesPath = imagesPath.substring(0, imagesPath.lastIndexOf("/"))+"/images/";
//            mImagesPath = imagesPath;
//        }
//        LoggerFactory.getLogger(WebVideConfig.class).info("imagesPath="+mImagesPath);
//        registry.addResourceHandler("/images/**").addResourceLocations(mImagesPath);
//        // TODO Auto-generated method stub
//        System.out.print("2.上传配置类mImagesPath=="+mImagesPath+"\n");
//        super.addResourceHandlers(registry);
//    }
//}
